{# One transaction in the drawer: what it was and who paid, and the refund form when it can be refunded (the whole amount unless it is lowered). #} {% from "components/macros/layout.html" import badge, card, dialog_title, facts as fact_list %} {% from "components/macros/form.html" import field, money_input, select, primary_button %}
{{ dialog_title("Transaction #" ~ txn.id) }}
{{ badge(status.label, status.tone) }}
{% call card("Details", id="payment-transaction-facts") %}{{ fact_list(facts) }}{% endcall %} {% if refund %} {% call card("Refund", id="payment-refund") %}
{% call field("Amount") %}{{ money_input("amount", refund.amount) }}{% endcall %} {% call field("Reason") %}{{ select("reason", refund.reasons, refund.reason, blank=None, block=True) }}{% endcall %} {{ primary_button("Issue refund", "submit") }}
{% endcall %} {% endif %}